<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Repomath</title>
<meta name="keywords" content="Learn by yourself" />
<link href="web/templatemo_style.css" rel="stylesheet" type="text/css" />

</head>

<body>

<?php
include 'global.php';
include REPOMATH_ROOT . '/model/Course.class.php';
include REPOMATH_ROOT . '/model/Topic.class.php';
?>

<div id="templatemo_container">
   
    <div id="templatemo_header">
    	<div id="logosection">
	        <div class="sitelogo"></div>
        	<div class="sitename">Repomath</div>
      </div>
        <div id="header">
        	<div class="title">
            	Georgia<br />
	        	<span class="bigtext">SouthWestern</span><br />
    	    	State University</div>

        </div>
	</div>
    
	<div id="templatemo_menu">
    	<div id="search"></div>
        <div id="menu">
            <ul>
                <li><a href="../index.php" class="current">Home</a></li>

                <li><a href="web/login.html.php">Login</a></li>
                <li><a href="web/Topic.html.php">Topic</a></li>
                <li><a href="web/Help.html">Help</a></li>
            </ul>
        </div>
	</div>
    
    <!-- start of content -->

	<div id="templatemo_content">
    
    	<!-- start of left column -->
    
    	<div id="templatemo_left_column">
    	  <div id="leftcolumn_box02">
   	    <h2>Course Level</h2>
   	    <ul>
   	    
<?php

if (!empty ($_GET['clv']))
	: for ($i = 1; $i < 5; $i++) {
		if ($_GET['clv'] == $i) {

			echo ('<li><a href="../index.php?clv=' . $_GET['clv'] . '" class="current">' . $i * 1000 . '</a></li>');
		} else {

			echo ("<li><a href='../index.php?clv=" . $i . "'>" . $i * 1000 . "</a></li>");
		}
	} else
	:
?>
                
                    <li><a href="../index.php?clv=1">1000</a></li>
                    <li><a href="../index.php?clv=2">2000</a></li>
                    <li><a href="../index.php?clv=3">3000</a></li>
                    <li><a href="../index.php?clv=4">4000</a></li>
                
<?php
 endif;
?>
		</ul>
            </div>
            
			<div id="imagebutton"></div>
            
        </div>
        
        <!-- end of left column -->
        
        <!-- start of middle column -->
        
    	<div id="templatemo_middle_column">     
             <div id="section2">
                <div class="section2_top">
                    <h2>List of Topics</h2>
                </div>
                <div class="section2_bottom">

			    	<ul>

<?php


if (!empty ($_GET['cid'])) {
	$topic = new Topic();
	$rows = $topic->getTopicByCo_id($_GET['cid']);
	if ($rows != null) {
		foreach ($rows as $row) {
			echo ("<li><a target='_self' href='web/topic.html.php?tid=" . $row['To_id'] . "'>" . $row["To_title"] . " </a></li>");

		}
	}
}
?>
                      
                       
					</ul>
                </div>
            </div>
        <div id="section2">
                <div class="section2_top">
                    <h2>List of Courses</h2>
                </div>
                
                <div class="section2_bottom">
			      	<ul>
<?php


if (!empty ($_GET['cid'])) {
	if (!empty ($_GET['clv'])) {
		$course = new Course();
		$rows = $course->getCourseByLevel($_GET['clv']);
		if ($rows != null) {
			foreach ($rows as $row) {
				if($row["Co_id"]==$_GET['cid']){
				echo ("<li><a href='../index.php?cid=" . $row["Co_id"] . "&clv=" . $_GET['clv'] . "' class='current'>" . $row["Co_title"] . "</a></li>");
				}else{
				echo ("<li><a href='../index.php?cid=" . $row["Co_id"] . "&clv=" . $_GET['clv'] . "'>" . $row["Co_title"] . "</a></li>");
				}
			}
		}
	}
} else {
	if (!empty ($_GET['clv'])) {
		$course = new Course();
		$rows = $course->getCourseByLevel($_GET['clv']);
		if ($rows != null) {
			foreach ($rows as $row) {
				echo ("<li><a href='../index.php?cid=" . $row["Co_id"] . "&clv=" . $_GET['clv'] . "'>" . $row["Co_title"] . "</a></li>");
			}
		}
	}
}
?>
					</ul>
                  
            	</div>
            </div>
        
       	 
              
      </div>
    
    <!-- end of content -->
        
        
  <div id="templatemo_footer">
        <a href="index.php">Home</a> | <a href="#">About Us</a>| <a href="#">Course</a> | <a href="#">Contact Us</a><br />
        Copyright © 2011 <a href="http://gsw.edu/main/">Georgia Southwestern State University</a></div>
    <div id="templatemo_footer_bottom"></div>

</div>
</body>
</html>